package cn.tedu.review;
/**本类用于回顾继承*/
public class TestExtends {
    public static void main(String[] args) {
        Animal a = new Animal();
        Cat c = new Cat();
        MM m = new MM();
    }
}
class Animal{
    public void eat(){
        System.out.println("Animal的eat功能");
    }
}
class Cat extends Animal{
    int a = 10;
    private int b = 100;
    public void play(){
        System.out.println(a);
        System.out.println(b);
    }
}
class MM extends Cat{
    public void Play2(){
        System.out.println(a);
//        System.out.println(b);//私有继承但访问限制不可用，会报错
    }
}
